Bulk Edit. Test 29. Merge snapshot data to fix missing data after hard refresh#43
Closed
LukasMod wants to merge 1 commit into
Closed
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Author
|
Already added to Expensify#84756 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Problem
After a hard refresh the "Edit multiple" button is missing, and even when forced to show, the edit page can't resolve
transaction contexts (empty fields, save does nothing). Opening each invoice report individually first fixes the issue.
Root Cause
After a hard refresh, invoice transaction data and IOU report actions exist only in the Search API snapshot — they are not populated in the main Onyx collections (
ONYXKEYS.COLLECTION.TRANSACTION, ONYXKEYS.COLLECTION.REPORT_ACTIONS).Standard expenses work because OpenApp/reconnect populates their transactions and IOU report actions into the main Onyx collections. Invoice reports only get a CREATED action, the IOU action is missing from the main collection until OpenReport is called for each individual invoice report.
Example
After hard refresh standard expense report 8404464406552585:
reportActionsCount: 2
reportActionNames: ["IOU", "IOU"] ← IOU actions present
transactions: found in ONYXKEYS.COLLECTION.TRANSACTION ✓
After hard refresh invoice report 6073924919161437:
reportActionsCount: 1
reportActionNames: ["CREATED"] ← Only CREATED, no IOU action
transactions: NOT found in ONYXKEYS.COLLECTION.TRANSACTION ✗
However, the Search API response DOES include both:
"reportActions_6073924919161437": {
"6528934650568349100": { "actionName": "IOU", ... }
}
This data goes into the search snapshot (SNAPSHOT_) but is never merged into the main Onyx collections.
Fix
Use the search snapshot data as a fallback when the main Onyx collections don't have the data. The snapshot is already available via SearchContext and contains the complete data from the Search API response.
Fixed Issues
Follow up Expensify#84756
$
PROPOSAL:
Tests
Test 1: Invoice bulk edit after hard refresh
Test 2: Invoice bulk edit without hard refresh
Test 3: Standard expense bulk edit (regression check)
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari